﻿using UnityEngine;
using System.Collections;

public class finish : MonoBehaviour {

	public playerGui playGUI;

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}

	void OnTriggerEnter(Collider col)
	{
		Debug.Log ("trigger");
		if(col.gameObject.tag=="Player")
		{
			Debug.Log("trigger Hit");
			if(col.gameObject.GetComponent<Character>().PlayerInd == 0)
			{
				Debug.Log("door open");
				playGUI.player1wins=true;
			}
			else
			{
				playGUI.player2wins=true;
			}
		}

	}
}
